package actions;

import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.AbstractAction;

public class QuitAction extends AbstractAction implements WindowListener {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4186611229271708114L;

	@Override
	public void actionPerformed(ActionEvent arg0) {
		//int answer = JOptionPane.showConfirmDialog(MainForm.getInstance(),"Unsaved changes will be lost...","The future is boring.",JOptionPane.YES_NO_OPTION);
		//if(answer==JOptionPane.YES_OPTION) System.exit(0);
		System.exit(0);
	}

	@Override
	public void windowActivated(WindowEvent e) {	
	}

	@Override
	public void windowClosed(WindowEvent e) {
	}

	@Override
	public void windowClosing(WindowEvent e) {
		actionPerformed(null);		
	}

	@Override
	public void windowDeactivated(WindowEvent e) {	
	}

	@Override
	public void windowDeiconified(WindowEvent e) {
	}

	@Override
	public void windowIconified(WindowEvent e) {	
	}

	@Override
	public void windowOpened(WindowEvent e) {	
	}

}
